#ifndef PLAYER_H
#define PLAYER_H

#include <memory>
#include "object.h"

class Arena;

class Player : public Object
{
public:

    Player();
    void init();


    float angle;           // kat obrotu obiektu wzgledem sceny
    float speed;           // predkosc
    float rot;             // predkosc obrotowa

    float friction;        // tarcie
    float rotfriction;     // tarcie obrotowe

    float acc;             // przyspieszenie
    float brake;           // hamowanie
    float rotacc;          // przyspieszenie obrotowe

    int shield;
    int health;
    int firing_range;



    bool alive;

    Arena* arena;

    Grid* current_states;
    Grid* new_states;

    std::shared_ptr<std::list<std::pair<int,Tile*> > >  path;// (angle,tile)

    void fire();
    void hit(int val);
    void purge();
    void control();
    void physics();
    void step();
    bool isColliding();
    std::shared_ptr<std::list<std::pair<int,Tile*> > > findPath(Object *);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget *);
    QRectF boundingRect() const;

};

#endif // PLAYER_H
